package com.jdk.thread.oschina;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

public class MyRejectedExecutionHandler implements RejectedExecutionHandler{

	@Override
	public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
		 System.out.println("Begin exception handler-----------");
	        //执行失败任务
	        new Thread(r,"exception by pool").start();
	        //打印线程池的对象
	        System.out.println("The pool RejectedExecutionHandler = "+executor.toString());
	}

}
